<?php

include_once APPLICATION_DIR.'/application/model/business/validator/base/IActionValidation.class.php';

abstract class PointSaleValidation implements IActionValidation {
    protected $rto;
    protected $validation;
    private $errorMessage;
    
    public function __construct(IActionValidation $validation,RTO $rto){
        $this->validation = $validation;
        $this->rto = $rto;
        $this->errorMessage = $validation->getErrorMessage();
    }
    
    public function getErrorMessage(){
        return $this->errorMessage;
    }
    
    public function addErrorMessage($msg){
        $this->errorMessage->addValue($msg);
    }
    
    public function checkValid(){
        if(!$this->validation->checkValid()){
            return false;
        }
        return $this->exec();
    }
    
    public abstract function exec();
}

?>
